1. Camada createRelu(WrapperCL *cl, unsigned int inx, unsigned int iny, unsigned int
inz, Tensor entrada, GPU_ERROR *error) {
2. if (error->error)return NULL;
3. CamadaRelu c = (CamadaRelu) calloc(1, sizeof(TypecamadaRelu));
4. c->super.gradsEntrada = newTensor(cl->context, inx, iny, inz, error);
5. c->super.saida = newTensor(cl->context, inx, iny, inz, error);
6. c->super.entrada = entrada;
7. if (!entrada) {
8. c->super.entrada = newTensor(cl->context, inx, iny, inz, error);
9. c->super.flag_releaseInput = 1;
10. }
11. c->super.release = (fv) realeaseRelu;
12. c->super.ativa = (fv) ativaRelu;
13. c->super.calc_grads = (fvv) calc_gradsRelu;
14. c->super.corrige_pesos = (fv) corrige_pesosRelu;
15. c->super.type = RELU;
16. c->super.salvar = (fsl) salvarRelu;
17. c->kernelReluAtiva = new_Kernel(cl->program, "reluativa", 3, VOID_P, VOID_P, INT);
18. c->kernelReluCalcGrads = new_Kernel(cl->program, "relucalcgrad", 4, VOID_P,
VOID_P, VOID_P, INT);
19. return (Camada) c;
20. }